<?php


namespace App\logic;
use App\Models\Menu;


class MenuLogic
{
    /**
     * 获取菜单
     * @return mixed
     */
    public static function index()
    {
        $where = ['field'=>'is_menu', 'value'=>1];
        $data = Menu::getMenu($where);
        if(!$data) abort(101,'数据错误');
        return $data;
    }

    public static function getMenuSon($name)
    {
        $where = ['field'=>'pid', 'value'=>$name];
        $data = Menu::getMenu($where);
        if(!$data) abort(101,'数据错误');
        return $data;
    }
}
